<%@ page import="org.springframework.util.ClassUtils" %>
<%@ page import="grails.plugin.searchable.internal.lucene.LuceneUtils" %>
<%@ page import="grails.plugin.searchable.internal.util.StringQueryUtils" %>

<!DOCTYPE html>
<html>
<head>
  <title><g:layoutTitle default="Developer Documentation and Time Tracking System" /></title>
  <r:require modules="application,chosen"/>
  <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
  <g:layoutHead />
  <uploader:head />
  <calendar:resources lang="en" theme="tiger"/>
  <r:layoutResources/>
  <ckeditor:resources />
  <g:javascript>
  function updateSelect(e) {
   	var resp = e
    //resp = eval("("+e+")");
    var rselect = document.getElementById(resp.id);
    rselect.length = 0;
    options = resp.data;
    
    var opt = document.createElement('option');
    opt.text = 'Select One...';
    opt.value = 'null';
    
    try {
      rselect.add(opt, null); // standards compliant; doesn't work in IE
    } catch(ex) {
      rselect.add(opt) // IE only
    }
    
    for(var i=0; i < options.length; i++) {
      var option = options[i];
      var opt = document.createElement('option');
      opt.text = option.description;
      opt.value = option.id;
      
      try {
        rselect.add(opt, null); // standards compliant; doesn't work in IE
      } catch(ex) {
        rselect.add(opt); // IE only
      }
    }
    //resp.id
    $('.tableForm select').chosen().trigger('liszt:updated')
  }
  
  function onLoadingSelect(id) {
    var rselect = document.getElementById(id);
    rselect.length = 0;
    
    var opt = document.createElement('option');
    opt.text = 'Loading...';
    opt.value = 'null';
    
    try {
      rselect.add(opt, null); // standards compliant; doesn't work in IE
    } catch(ex) {
      rselect.add(opt); // IE only
    }
    
    rselect.add(opt, null);
  }
  </g:javascript>
</head>
<body class="uow">
  <div class="wrap">
    <div class="clearfix" id="header">
      <div id="uowlogo"><a href="http://www.uow.edu.au/index.html"><img alt="University of Wollongong" title="University of Wollongong" src="${resource(dir:'css',file:'img_logo_uow.png') }"></a></div>
      <div id="logout">
        <span>You are signed in as <strong><sec:username /></strong></span>
        <span class="logout"><a href="/devdocs/logout">LOGOUT</a></span>
      </div>
      <ul id="top-links">
        <li><g:form url='[controller: "globalSearch", action: "search"]' id="searchableForm" name="searchableForm" method="get"><g:textField id="global_search" name="q" value="${params.q}" /> <input class="search" type="submit" value="Search" /></g:form></li>
      </ul>
    </div>
    <div class="clearfix" id="content-box">
      <div class="clearfix" id="content">
        <div id="page-title">Developer Documentation and Time Tracking System</div>
        <div class="submenu">
          <ul class="left">
            <li><a href="#" class="menu">Issues</a>
            <ul>
              <li><a href="/devdocs/issue/create">New</a></li>
              <li><a href="/devdocs/issue/list">Show All</a></li>
            </ul>
            </li>
            <li><a href="#" class="menu">Tasks</a>
            <ul>
              <li><a href="/devdocs/developmentTask/create">New</a></li>
              <li><a href="/devdocs/developmentTask/list">Show All</a></li>
            </ul>
            </li>
            <li><a href="#" class="menu">Deployments</a>
            <ul>
              <li><a href="/devdocs/deployment/create">New</a></li>
              <li><a href="/devdocs/deployment/list">Show All</a></li>
            </ul>
            </li>
            <li><a href="#" class="menu">Admin</a>
            <ul>
              <li><a href="/devdocs/system/list">Systems</a></li>
              <li><a href="/devdocs/project/list">Projects</a></li>
              <li><a href="/devdocs/person/list">People</a></li>
              <li><a href="/devdocs/checklist/list">Check Lists</a></li>
              <li><a href="/devdocs/phase/list">Phases</a></li>
            </ul>
            </li>
            <li><a href="#" class="menu">Track Time</a>
            <ul>
              <li><a href="/devdocs/timeTracker/calendar">Record</a></li>
              <li><a href="/devdocs/timeTracker/list">Search</a></li>
            </ul>
            </li>
            <li><a href="#" class="menu">Assignments</a>
            <ul>
              <li><a href="/devdocs/assignment/list">Show All</a></li>
            </ul>
            </li>
            <li><a href="#" class="menu">Shortcuts</a>
            <ul>
              <li><g:remoteLink url="[controller:'person',action:'getProjectFilter']" after="jQuery('#projectFilter').show();jQuery('#projectFilter').dialog()" update="projectFilter">Project Filter</g:remoteLink></li>
              <li><a href="/devdocs/developmentTask/quickTask">Quick Task</a></li>
            </ul>
            </li>
          </ul>
        </div>
        <div id="column-main">
          <g:layoutBody />
        </div>
      </div>
    </div>
    <div id="footer" class="clearfix">
      <div class="copyright footer"> Copyright &copy; 2012 University of Wollongong. CRICOS Provider No: 00102E | <a href="http://www.uow.edu.au/about/privacy/index.html">Privacy</a> | <a href="http://www.uow.edu.au/about/disclaimer/index.html">Disclaimer &amp; Copyright Info</a> | <a href="http://www.uow.edu.au/about/brand/web/index.html">Website Information</a> | <a href="http://www.uow.edu.au/about/contacts/ask/index.html">Help</a> | <a href="http://www.uow.edu.au/sitemap/index.html">Site Map</a></div>
    </div>
  </div>
  <div class="hidden">
    <div id="projectFilter"></div>
  </div>
  <r:layoutResources/>
  <script>
  $('.datepicker').datepicker( {dateFormat: 'dd/mm/yy'});
  $('.tableForm select').chosen({search_contains:true});
  </script>
</body>
</html>